{% load ts_extras %}
<div class="treeview-lv1">
    <div class="collapsed treeview-header">
        <h4>Gene list</h4>
        <a class="expand" href="#" title="expand" ></a>
        <a class="collap" href="#" title="collap" ></a>
    </div>
    <div class="expanded">
{% if request.session.ts_program.tp.gene_list %}
    <ul class="list-lv2">
    {% for g in request.session.ts_program.tp.gene_list %}
        <li>
            <div class="collapsed">
                <a title="Gene {{g.name}}" href="{% url ts.views.editGene request.session.ts_program.tp.name|escapeUrl g.name %}">{{g.name}}</a>
                <a class="expand" href="#" title="expand" ></a>
                <a class="collap" href="#" title="collap" ></a>
                <a id="{% url ts.views.delGene request.session.ts_program.tp.name|escapeUrl g.name %}" rev="gene" class="delete" href="#" title="delete" ></a>
            </div>
            <div class="expanded">
            <ul>
                <li><label>Product:</label> {{g.product_name}}</li>
                <li>
                    <label>Promoters: {{g.promoter.count}}</label><br/>
                    <ul>
                        {% for p in g.promoter %}
                            <li>
                                {{p}}
                            </li>
                        {% endfor %}
                    </ul>    
                </li>
            </ul>
            </div>
        </li>
    {% endfor%}
    </ul>
    {%else%}
    <p>No genes</p>
    {%endif%}
    </div>
</div>